package com.lwj.controller;

import com.lwj.entity.ProjectTeam;
import com.lwj.entity.Team;
import com.lwj.service.ProjectTeamService;
import com.lwj.util.DataRet;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**竞标相关
 * @author linwj
 * @date 2018/5/12 9:58
 */

@RestController
@RequestMapping("/projectCompete")
public class ProjectCompeteController {

    @Autowired
    private ProjectTeamService projectTeamService;

    /**
     * 投标项目
     * @param teamId
     * @param projectId
     * @return
     */
    @RequestMapping("")
    public DataRet<String> projectCompete(int teamId,int projectId){
        return projectTeamService.projectCompete(teamId,projectId);
    }

    /**
     * 验证团队的投标状态
     * @param teamId
     * @param projectId
     * @return
     */
    @PostMapping("/validation")
    public DataRet<String> validateProjectStatus(int teamId,int projectId){
        return projectTeamService.projectValidate(teamId,projectId);
    }

    /**
     * 获取项目投标队伍信息
     * @param projectId
     * @return
     */
    @PostMapping("/competeTeam")
    public DataRet<List<Team>> getCompeteTeam(int projectId){
        return projectTeamService.getCompeteTeam(projectId);
    }

    /**
     * 确定投标队伍
     * @param projectId
     * @param teamId
     * @return
     */
    @PostMapping("/ensure")
    public DataRet<String> ensureTeam(int projectId,int teamId){
        return  projectTeamService.ensureTeam(projectId,teamId);
    }

}
